<?php

class karyawan_model extends CI_Model {

    public function __construct() {
        $this->load->database();
    }

    public function getKaryawan($whr, $offset) {
        if ($whr == "") {
            $sql = "SELECT * FROM mt_karyawan where nik !='xx11xx'
                    ORDER BY nik ASC";
        } else {
            $sql = "SELECT * FROM mt_karyawan WHERE " . $whr
                    . "ORDER BY nik";
        }
        $resultSet = $this->db->query($sql);
        return $resultSet;
    }

    public function getAllKaryawan($whr) {
        if ($whr == "") {
            $sql = "SELECT * FROM mt_karyawan where nik !='xx11xx' ORDER BY nik ASC";
        } else {
            $sql = "SELECT * FROM mt_karyawan WHERE " . $whr ." ORDER BY nik ASC";
        }

        $resultSet = $this->db->query($sql);
        return $resultSet;
    }

}

?>
